package nml.mail.reg.smtp;
import java.util.List;

import nml.mail.reg.Reg;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class  mail_ru extends Reg{

	public void reg(String username, String password) {		
		

		String url = "http://e.mail.ru/cgi-bin/signup?from=navi&lang=en_US";
		get(url);
		
		
		dr.findElement(By.id("noPhoneLink")).click();
		
		List<WebElement> ws = dr.findElementsByTagName("input");
		/* 
		for (int i = 0; i < ws.size(); i++) {
			WebElement w = ws.get(i);

			if (w.isDisplayed()) {
				w.sendKeys(String.valueOf(i));
			}
		}
		*/
		ws.get(20).sendKeys("Tian");
		ws.get(21).sendKeys("Mao");
		ws.get(24).sendKeys(username);
		ws.get(21).sendKeys("Mao");
		ws.get(25).sendKeys(password);
		ws.get(26).sendKeys(password);
		
		ws.get(29).sendKeys("ChangeW");
		
		
		dr.findElementByClassName("days").sendKeys("21");
		dr.findElementByClassName("months").sendKeys("May");
		dr.findElementByClassName("years").sendKeys("1990");
		
		dr.findElementByName("Password_Question").sendKeys("What model was your first car?");
		 
		dr.findElementById("man1").click();
		
		dr.findElementByClassName("js-submit").click();
		
		System.out.println(username+"@mail.ru");
	}

	public static void main(String[] args) {
		new mail_ru().reg("qq331798654", "qq3131798654");
	}
	
	
}
